<?
session_start();
include('../config.php');
//include('header.php');
require_once('../classes/class.jira.php');
include("../classes/connect.php");
ini_set('display_errors', 'Off');

if(!isset($_SESSION["Juname"])){
	 
	echo '<meta http-equiv="refresh" content="300;url=index.php">';
}

function getuser($username,$pass,$project,$host){
		$config->username= $username;
		$config->password= $pass;
		$config->port= "";
		$config->host= $host;
		$query->project = $project;

		$queryIssue = new Jira($config);
		$array=$queryIssue->queryUser($query);
		$response = json_decode($array->responseBody);
		return $response;
		}
function getpriority($username,$pass,$host){
		$config->username= $username;
		$config->password= $pass;
		$config->port= "";
		$config->host= $host;

		$queryIssue = new Jira($config);
		$array=$queryIssue->queryAllPriority();
		$response = json_decode($array->responseBody);
		return $response;
		}

		
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Basic usage</title>

        <link href="examples/content/shared/styles/examples-offline.css" rel="stylesheet">
        <link href="examples/content/shared/styles/kendo.common.min.css" rel="stylesheet">
        <link href="examples/content/shared/styles/kendo.rtl.min.css" rel="stylesheet">
        <link href="examples/content/shared/styles/kendo.default.min.css" rel="stylesheet">

        <script src="js/jquery.min.js"></script>
        <script src="js/kendo.web.min.js"></script>
        <script src="js/console.js"></script>
        
        <script src="reports/js/jquery.min.js"></script>
        <script src="reports/js/kendo.web.min.js"></script>
        <script src="reports/js/console.js"></script>
        <link rel="stylesheet" href="../css/header.css" type="text/css" media="all">     
        <link rel="stylesheet" href="../css/layout_1.css" type="text/css" media="all">
        <link href="../css/demo.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="paginate/styles/style.css" />
        <script>

        </script>


    </head>
    <body class="sonata-bc" >
    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container-fluid header-bar-container">
                <div class="header-bar-top">
                    <a class="brand">
                        <img src="images/logo_white.png" alt="JiraPortal">Recruitment Application      
                    </a>
                </div>
            </div>

            <div class="container-fluid">
                <a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <div class="nav-collapse">
                    <ul class="nav" id="menu" style="background-color: #1C2326;margin: 0;">
                        <li class="active">
                            <a href="../home.php">Home</a>
                        </li>
                        <li >
                            <a class="dropdown-toggle" data-toggle="dropdown" href="reportdash.php"> Reports</a> 
                        </li>
                        
                         <li >
                            <a class="dropdown-toggle" data-toggle="dropdown" href="delayreport.php"> Delay Reports</a> 
                        </li>

                        <div class="navbar-text" style="top: 18px;">
                            <p style="color: #FFFFFF;font-size: 15px;font-weight: 100;"> Welcome <?=$username?> [ <a href="../logout.php" style="color: #3C9632">Logout</a> ]<p>
                </div>
            </div>
        </div>

        </div>
    </div>
       
        
        <?php
            if (isset($_GET['type']) && isset($_GET['cat'])) 
            {
                $reporttype1 = $_GET['type'];
                $reporttype=  html_entity_decode($reporttype1);
                $types = explode(" - ", $reporttype);
                $cat = $_GET['cat'];

                if ($cat == 'week') 
                    {
        ?>
                        <h2 class="configHead">Week <?php echo $types[0];?> Summary - From  <?php echo date('d-m-Y', strtotime('last monday')) . " to ";
                                                echo date('d-m-Y'); ?> </h2>
                           
                            <script>              
                            $(document).ready(function () {
                                var ty='<?php echo $types[0]; ?>';
                                var fromdatestr = '<?php echo date('Y/m/d', strtotime('last monday')); ?>';
                                var todatestr = '<?php echo date('Yd/m/d'); ?>';
                        
                                if(ty==='Open CV')
                                {                       
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                        url: 'ajaxdetails.php?cat=week&type=OpenCV&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                    },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Short Listed')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                         read: {
                                        url: 'ajaxdetails.php?cat=week&type=Short Listed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                    },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Test Called')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                        url: 'ajaxdetails.php?cat=week&type=Test Called&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }
                                else if(ty==='Rejected')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                            url: 'ajaxdetails.php?cat=week&type=Rejected&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                            dataType: "json"
                                            }
                                        },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Interviewed')
                                {
                                        var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Interviewed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }  
                                else if(ty==='Tested')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Tested&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Selected')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Selected&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Offered')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Offered&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Interviewed Called')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Interview Called&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }
                                else if(ty==='Final Interview Called')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Final Interview Call&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Final Interviewed')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Final Interviewed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Joined')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Joined&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }

                                dataSource.fetch(function(){
                                   var data = this.data();
                                    console.log(data.length);
                                });
                                $("#grid").kendoGrid({
                                    dataSource: dataSource,
                                    groupable: true,
                                    sortable: true,
                                     selectable: "row",
                                      filterable:{
                                        extra: false,
                                        operators: {
                                            string: {
                                                startswith: "Starts with",
                                                eq: "Is equal to",
                                                neq: "Is not equal to"
                                            },
                                             date: {
                                                startswith: "Starts with",

                                            }
                                        }},
                                    pageable: {
                                        refresh: true,
                                        pageSizes: true
                                    },
                                    columns:[{ field: "name", title: "Name"}, 
                                    { field: "email",title: "E-Mail"},
                                    { field: "subject", title: "Subject"},
                                    { field: "ReceivedDate",title: "Received Date", format: "{0:MM/dd/yyyy HH:mm tt}"},
                                    { field: "ModifiedDate",title: "Modified Date", format: "{0:MM/dd/yyyy HH:mm tt}",},
                                    { field: "modifyby",title: "Modified By"},
                                    { field: "priority",title: "Priority"},
                                    { field: "currentass",title: "Current Assignee Name"},
                                    { field: "elapsed",title: "Time Elapsed"},
                                    { field: "jiraid",title: "jiraid",width:1},
                                    { field: "vcode",title: "vcode",width:1},
                                    { field: "cus",title: "cus",width:1},
                                    { field: "rwid",title: "id",width:1}]
                                });
                                 var grid = $('#grid').data('kendoGrid');
                                grid.hideColumn(9);
                                
                                var grid2 = $('#grid').data('kendoGrid');
                                grid2.hideColumn(13);
                                var grid3 = $('#grid').data('kendoGrid');
                                grid3.hideColumn(12);
                                var grid4 = $('#grid').data('kendoGrid');
                                grid4.hideColumn(10);
                                 var grid4 = $('#grid').data('kendoGrid');
                                grid4.hideColumn(11);
                                
                                
                                 $('#assignee').change(function (){

                            $("#grid").data("kendoGrid").dataSource.data([]);
                           viewGrid1();

                           });

                            $('#post').change(function (){

                              $("#grid").data("kendoGrid").dataSource.data([]);
                                viewGrid1();

                           });

                        $('#priority').change(function (){

                          $("#grid").data("kendoGrid").dataSource.data([]);
                            viewGrid1();

                       });
                       });
                       
                function viewGrid1()
               {
                               var ty='<?php echo $types[0]; ?>';
                                var fromdatestr = '<?php echo date('Y/m/d', strtotime('last monday')); ?>';
                                var todatestr = '<?php echo date('Yd/m/d'); ?>';
                        
                    
                       
                        var b=document.getElementById("assignee");
                        var assignee=b.options[b.selectedIndex].value;
                        var c=document.getElementById("priority");
                        var priority=c.options[c.selectedIndex].value;
                        var e=document.getElementById("post");
                        var post=e.options[e.selectedIndex].value;
                        
                       // alert(assignee);
        
                                if(ty==='Open CV')
                                {                       
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                        url: 'ajaxdetailsFilter.php?post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=OpenCV&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                            
                                    },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Short Listed')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                         read: {
                                        url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Short Listed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                    },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Test Called')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                        url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Test Called&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }
                                else if(ty==='Rejected')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                            url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Rejected&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                            dataType: "json"
                                            }
                                        },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Interviewed')
                                {
                                        var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Interviewed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }  
                                else if(ty==='Tested')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Tested&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Selected')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Selected&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Offered')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Offered&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Interviewed Called')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Interview Called&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }
                                else if(ty==='Final Interview Called')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Final Interview Call&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Final Interviewed')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Final Interviewed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Joined')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Joined&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }

                        dataSource.fetch(function(){
                           var data = this.data();
                            console.log(data.length);
                        });
                        $("#grid").kendoGrid({
                            dataSource: dataSource,
                            groupable: true,
                            sortable: true,
                            selectable: "row",
                            dataBound: onDataBound,
                            filterable:{
                            extra: false,
                            operators: {
                                string: {
                                    startswith: "Starts with",
                                    eq: "Is equal to",
                                    neq: "Is not equal to"
                                },
                                 date: {
                                    startswith: "Starts with",
                                   
                                }
                            }},
                            pageable: {
                                refresh: true,
                                pageSizes: true
                            },
                            columns:[{ field: "name", title: "Name"}, 
                                    { field: "email",title: "E-Mail"},
                                    { field: "subject", title: "Subject"},
                                    { field: "ReceivedDate",title: "Received Date", format: "{0:MM/dd/yyyy HH:mm tt}"},
                                    { field: "ModifiedDate",title: "Modified Date", format: "{0:MM/dd/yyyy HH:mm tt}"},
                                    { field: "modifyby",title: "Modified By"},
                                    { field: "priority",title: "Priority"},
                                    { field: "currentass",title: "Current Assignee Name"},
                                    { field: "elapsed",title: "Time Elapsed"},
                                    { field: "jiraid",title: "jiraid"},
                                    { field: "vcode",title: "vcode"},
                                    { field: "cus",title: "cus"},
                                    { field: "rwid",title: "id"}]
                        });
                         var grid = $('#grid').data('kendoGrid');
                        grid.hideColumn(9);
                        var grid2 = $('#grid').data('kendoGrid');
                        grid2.hideColumn(13);
                        var grid3 = $('#grid').data('kendoGrid');
                        grid3.hideColumn(12);
                        var grid4 = $('#grid').data('kendoGrid');
                        grid4.hideColumn(10);
                         var grid4 = $('#grid').data('kendoGrid');
                        grid4.hideColumn(11);
                        
                            
                        
                        
                        
               }
              

                       function onDataBound(e) {
                            var grid = $("#grid").data("kendoGrid");

                            $("#grid").delegate("tbody>tr", "dblclick", function(){
                                var row = $(this).closest("tr");
                                var rowIdx = $("tr", grid.tbody).index(row);
                                var colIdx = $("td", row).index(this);
                                var row = grid.select();
                                var data = grid.dataItem(row);
                                var url='../edit.php?id='+data.rwid+'&jiraid='+data.jiraid+'&currentstatus='+data.cus+'&currentassignee='+data.currentass+'&vcode='+data.vcode;
        //                      
                                    var newwindow=window.open(url,'name','height=700,width=1340,scrollbars=yes');
                                    if (window.focus) {newwindow.focus()}
                                   return false;
                           
                        
                })};
                        </script>

        <?php
                    }
                    if ($cat == 'year') {
        ?>

                     <h2 class="configHead">Year <?php echo $types[0];?> Summary - From   <?php echo date('d-m-Y', strtotime('first day of January ' . date('Y'))) . " to ";
                                echo date('d-m-Y'); ?> </h2>

                        <script>              
                            $(document).ready(function () {
                                var ty='<?php echo $types[0]; ?>';
                                var fromdatestr = '<?php echo date('Y'); ?>';
                                var todatestr = '<?php echo date('d/m/Y', strtotime('next friday')); ?>';
                        
                                if(ty==='Open CV')
                                {                       
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                        url: 'ajaxdetails.php?cat=year&type=OpenCV&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                            
                                    },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Short Listed')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                         read: {
                                        url: 'ajaxdetails.php?cat=year&type=Short Listed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                    },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Test Called')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                        url: 'ajaxdetails.php?cat=year&type=Test Called&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }
                                else if(ty==='Rejected')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                            url: 'ajaxdetails.php?cat=year&type=Rejected&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                            dataType: "json"
                                            }
                                        },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Interviewed')
                                {
                                        var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=year&type=Interviewed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }  
                                else if(ty==='Tested')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=year&type=Tested&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Selected')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=year&type=Selected&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Offered')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=year&type=Offered&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Interviewed Called')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=year&type=Interview Called&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }
                                else if(ty==='Final Interview Called')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=year&type=Final Interview Call&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Final Interviewed')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=year&type=Final Interviewed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Joined')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=year&type=Joined&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }

                        dataSource.fetch(function(){
                           var data = this.data();
                            console.log(data.length);
                        });
                        $("#grid").kendoGrid({
                            dataSource: dataSource,
                            groupable: true,
                            sortable: true,
                            selectable: "row",
                            dataBound: onDataBound,
                            filterable:{
                            extra: false,
                            operators: {
                                string: {
                                    startswith: "Starts with",
                                    eq: "Is equal to",
                                    neq: "Is not equal to"
                                },
                                 date: {
                                    startswith: "Starts with",
                                   
                                }
                            }},
                            pageable: {
                                refresh: true,
                                pageSizes: true
                            },
                            columns:[{ field: "name", title: "Name"}, 
                                    { field: "email",title: "E-Mail"},
                                    { field: "subject", title: "Subject"},
                                    { field: "ReceivedDate",title: "Received Date", format: "{0:MM/dd/yyyy HH:mm tt}"},
                                    { field: "ModifiedDate",title: "Modified Date", format: "{0:MM/dd/yyyy HH:mm tt}",},
                                    { field: "modifyby",title: "Modified By"},
                                    { field: "priority",title: "Priority"},
                                    { field: "currentass",title: "Current Assignee Name"},
                                    { field: "elapsed",title: "Time Elapsed"},
                                    { field: "jiraid",title: "jiraid"},
                                    { field: "vcode",title: "vcode"},
                                    { field: "cus",title: "cus"},
                                    { field: "rwid",title: "id"}]
                        });
                         var grid = $('#grid').data('kendoGrid');
                        grid.hideColumn(9);
                        var grid2 = $('#grid').data('kendoGrid');
                        grid2.hideColumn(13);
                        var grid3 = $('#grid').data('kendoGrid');
                        grid3.hideColumn(12);
                        var grid4 = $('#grid').data('kendoGrid');
                        grid4.hideColumn(10);
                         var grid4 = $('#grid').data('kendoGrid');
                        grid4.hideColumn(11);
                        
                        
                        
                        
                        
                          $('#assignee').change(function (){

                            $("#grid").data("kendoGrid").dataSource.data([]);
                           viewGrid();

                           });

                            $('#post').change(function (){

                              $("#grid").data("kendoGrid").dataSource.data([]);
                                viewGrid();

                           });

                        $('#priority').change(function (){

                          $("#grid").data("kendoGrid").dataSource.data([]);
                            viewGrid();

                       });
                    
               });
               
               function viewGrid()
               {
                                var ty='<?php echo $types[0]; ?>';
                                var fromdatestr = '<?php echo date('Y'); ?>';
                                var todatestr = '<?php echo date('d/m/Y', strtotime('next friday')); ?>';
                        
                    
                       
                        var b=document.getElementById("assignee");
                        var assignee=b.options[b.selectedIndex].value;
                        var c=document.getElementById("priority");
                        var priority=c.options[c.selectedIndex].value;
                        var e=document.getElementById("post");
                        var post=e.options[e.selectedIndex].value;
                        
                       // alert(assignee);
        
                                if(ty==='Open CV')
                                {                       
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                        url: 'ajaxdetailsFilter.php?post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=year&type=OpenCV&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                            
                                    },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Short Listed')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                         read: {
                                        url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=year&type=Short Listed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                    },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Test Called')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                        url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=year&type=Test Called&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }
                                else if(ty==='Rejected')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                            url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=year&type=Rejected&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                            dataType: "json"
                                            }
                                        },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Interviewed')
                                {
                                        var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=year&type=Interviewed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }  
                                else if(ty==='Tested')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=year&type=Tested&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Selected')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=year&type=Selected&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Offered')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=year&type=Offered&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Interviewed Called')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=year&type=Interview Called&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }
                                else if(ty==='Final Interview Called')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=year&type=Final Interview Call&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Final Interviewed')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=year&type=Final Interviewed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Joined')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=year&type=Joined&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }

                        dataSource.fetch(function(){
                           var data = this.data();
                            console.log(data.length);
                        });
                        $("#grid").kendoGrid({
                            dataSource: dataSource,
                            groupable: true,
                            sortable: true,
                            selectable: "row",
                            dataBound: onDataBound,
                            filterable:{
                            extra: false,
                            operators: {
                                string: {
                                    startswith: "Starts with",
                                    eq: "Is equal to",
                                    neq: "Is not equal to"
                                },
                                 date: {
                                    startswith: "Starts with",
                                   
                                }
                            }},
                            pageable: {
                                refresh: true,
                                pageSizes: true
                            },
                            columns:[{ field: "name", title: "Name"}, 
                                    { field: "email",title: "E-Mail"},
                                    { field: "subject", title: "Subject"},
                                    { field: "ReceivedDate",title: "Received Date", format: "{0:MM/dd/yyyy HH:mm tt}"},
                                    { field: "ModifiedDate",title: "Modified Date", format: "{0:MM/dd/yyyy HH:mm tt}",},
                                    { field: "modifyby",title: "Modified By"},
                                    { field: "priority",title: "Priority"},
                                    { field: "currentass",title: "Current Assignee Name"},
                                    { field: "elapsed",title: "Time Elapsed"},
                                    { field: "jiraid",title: "jiraid"},
                                    { field: "vcode",title: "vcode"},
                                    { field: "cus",title: "cus"},
                                    { field: "rwid",title: "id"}]
                        });
                         var grid = $('#grid').data('kendoGrid');
                        grid.hideColumn(9);
                        var grid2 = $('#grid').data('kendoGrid');
                        grid2.hideColumn(13);
                        var grid3 = $('#grid').data('kendoGrid');
                        grid3.hideColumn(12);
                        var grid4 = $('#grid').data('kendoGrid');
                        grid4.hideColumn(10);
                         var grid4 = $('#grid').data('kendoGrid');
                        grid4.hideColumn(11);
                        
                        
               }
               function onDataBound(e) {
                    var grid = $("#grid").data("kendoGrid");
                    
                    $("#grid").delegate("tbody>tr", "dblclick", function(){
                        var row = $(this).closest("tr");
                        var rowIdx = $("tr", grid.tbody).index(row);
                        var colIdx = $("td", row).index(this);
                        var row = grid.select();
                        var data = grid.dataItem(row);
                        var url='../edit.php?id='+data.rwid+'&jiraid='+data.jiraid+'&currentstatus='+data.cus+'&currentassignee='+data.currentass+'&vcode='+data.vcode;
//                      
                            var newwindow=window.open(url,'name','height=700,width=1340,scrollbars=yes');
                            if (window.focus) {newwindow.focus()}
                           return false;
                           
                        
                })};
            
            
            
                </script>

                <?php
                    }
                    if($cat=='manual')
                    {
                ?>
                  <h2 class="configHead">Report From   <?php echo $_GET['from'] . " to ";
                                echo $_GET['to']; ?> </h2>

                        <script>              
                            $(document).ready(function () {
                                var ty='<?php echo $types[0]; ?>';
                                var fromdatestr = '<?php echo $_GET['from']; ?>';
                                var todatestr = '<?php echo $_GET['to']; ?>';
                        
                                if(ty==='Open CV')
                                {                       
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                        url: 'ajaxdetails.php?cat=week&type=OpenCV&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                            
                                    },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Short Listed')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                         read: {
                                        url: 'ajaxdetails.php?cat=week&type=Short Listed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                    },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Test Called')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                        url: 'ajaxdetails.php?cat=week&type=Test Called&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }
                                else if(ty==='Rejected')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                            url: 'ajaxdetails.php?cat=week&type=Rejected&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                            dataType: "json"
                                            }
                                        },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Interviewed')
                                {
                                        var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Interviewed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }  
                                else if(ty==='Tested')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Tested&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Selected')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Selected&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Offered')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Offered&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Interviewed Called')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Interview Called&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }
                                else if(ty==='Final Interview Called')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Final Interview Call&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Final Interviewed')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Final Interviewed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Joined')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetails.php?cat=week&type=Joined&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }

                        dataSource.fetch(function(){
                           var data = this.data();
                            console.log(data.length);
                        });
                        $("#grid").kendoGrid({
                            dataSource: dataSource,
                            groupable: true,
                            sortable: true,
                            selectable: "row",
                            dataBound: onDataBound,
                            filterable:{
                            extra: false,
                            operators: {
                                string: {
                                    startswith: "Starts with",
                                    eq: "Is equal to",
                                    neq: "Is not equal to"
                                },
                                 date: {
                                    startswith: "Starts with",
                                   
                                }
                            }},
                            pageable: {
                                refresh: true,
                                pageSizes: true
                            },
                            columns:[{ field: "name", title: "Name"}, 
                                    { field: "email",title: "E-Mail"},
                                    { field: "subject", title: "Subject"},
                                    { field: "ReceivedDate",title: "Received Date", format: "{0:MM/dd/yyyy HH:mm tt}"},
                                    { field: "ModifiedDate",title: "Modified Date", format: "{0:MM/dd/yyyy HH:mm tt}",},
                                    { field: "modifyby",title: "Modified By"},
                                    { field: "priority",title: "Priority"},
                                    { field: "currentass",title: "Current Assignee Name"},
                                    { field: "elapsed",title: "Time Elapsed"},
                                    { field: "jiraid",title: "jiraid"},
                                    { field: "vcode",title: "vcode"},
                                    { field: "cus",title: "cus"},
                                    { field: "rwid",title: "id"}]
                        });
                         var grid = $('#grid').data('kendoGrid');
                        grid.hideColumn(9);
                        var grid2 = $('#grid').data('kendoGrid');
                        grid2.hideColumn(13);
                        var grid3 = $('#grid').data('kendoGrid');
                        grid3.hideColumn(12);
                        var grid4 = $('#grid').data('kendoGrid');
                        grid4.hideColumn(10);
                         var grid4 = $('#grid').data('kendoGrid');
                        grid4.hideColumn(11);
                        
                         $('#assignee').change(function (){

                     $("#grid").data("kendoGrid").dataSource.data([]);
                    viewGrid2();

                    });

                     $('#post').change(function (){

                       $("#grid").data("kendoGrid").dataSource.data([]);
                         viewGrid2();

                    });

                     $('#priority').change(function (){

                       $("#grid").data("kendoGrid").dataSource.data([]);
                         viewGrid2();

                    });
               });
               function onDataBound(e) {
                    var grid = $("#grid").data("kendoGrid");
                    
                    $("#grid").delegate("tbody>tr", "dblclick", function(){
                        var row = $(this).closest("tr");
                        var rowIdx = $("tr", grid.tbody).index(row);
                        var colIdx = $("td", row).index(this);
                        var row = grid.select();
                        var data = grid.dataItem(row);
                        var url='../edit.php?id='+data.rwid+'&jiraid='+data.jiraid+'&currentstatus='+data.cus+'&currentassignee='+data.currentass+'&vcode='+data.vcode;
//                      
                            var newwindow=window.open(url,'name','height=700,width=1340,scrollbars=yes');
                            if (window.focus) {newwindow.focus()}
                           return false;                          
                        
                })};
            
            
                   
                    
                     function viewGrid2()
               {
                                var ty='<?php echo $types[0]; ?>';
                                var fromdatestr = '<?php echo $_GET['from']; ?>';
                                var todatestr = '<?php echo $_GET['to']; ?>';
                        
                    
                       
                        var b=document.getElementById("assignee");
                        var assignee=b.options[b.selectedIndex].value;
                        var c=document.getElementById("priority");
                        var priority=c.options[c.selectedIndex].value;
                        var e=document.getElementById("post");
                        var post=e.options[e.selectedIndex].value;
                        
                        alert(assignee);
        
                                if(ty==='Open CV')
                                {                       
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                        url: 'ajaxdetailsFilter.php?post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=OpenCV&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                            
                                    },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Short Listed')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                         read: {
                                        url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Short Listed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                    },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Test Called')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                        url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Test Called&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }
                                else if(ty==='Rejected')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                            url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Rejected&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                            dataType: "json"
                                            }
                                        },
                                    pageSize: 15
                                    });
                                }
                                else if(ty==='Interviewed')
                                {
                                        var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Interviewed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }  
                                else if(ty==='Tested')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Tested&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Selected')
                                {
                                    var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Selected&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Offered')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Offered&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Interviewed Called')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Interview Called&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }
                                else if(ty==='Final Interview Called')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Final Interview Call&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Final Interviewed')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Final Interviewed&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15
                                    });
                                }
                                else if(ty==='Joined')
                                {
                                  var dataSource = new kendo.data.DataSource({
                                        transport: {
                                            read: {
                                                url: 'ajaxdetailsFilter.php?&post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type=Joined&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                                dataType: "json"
                                            }
                                        },
                                        pageSize: 15

                                    });
                                }

                        dataSource.fetch(function(){
                           var data = this.data();
                            console.log(data.length);
                        });
                        $("#grid").kendoGrid({
                            dataSource: dataSource,
                            groupable: true,
                            sortable: true,
                            selectable: "row",
                            dataBound: onDataBound,
                            filterable:{
                            extra: false,
                            operators: {
                                string: {
                                    startswith: "Starts with",
                                    eq: "Is equal to",
                                    neq: "Is not equal to"
                                },
                                 date: {
                                    startswith: "Starts with",
                                   
                                }
                            }},
                            pageable: {
                                refresh: true,
                                pageSizes: true
                            },
                            columns:[{ field: "name", title: "Name"}, 
                                    { field: "email",title: "E-Mail"},
                                    { field: "subject", title: "Subject"},
                                    { field: "ReceivedDate",title: "Received Date", format: "{0:MM/dd/yyyy HH:mm tt}"},
                                    { field: "ModifiedDate",title: "Modified Date", format: "{0:MM/dd/yyyy HH:mm tt}",},
                                    { field: "modifyby",title: "Modified By"},
                                    { field: "priority",title: "Priority"},
                                    { field: "currentass",title: "Current Assignee Name"},
                                    { field: "elapsed",title: "Time Elapsed"},
                                    { field: "jiraid",title: "jiraid"},
                                    { field: "vcode",title: "vcode"},
                                    { field: "cus",title: "cus"},
                                    { field: "rwid",title: "id"}]
                        });
                         var grid = $('#grid').data('kendoGrid');
                        grid.hideColumn(9);
                        var grid2 = $('#grid').data('kendoGrid');
                        grid2.hideColumn(13);
                        var grid3 = $('#grid').data('kendoGrid');
                        grid3.hideColumn(12);
                        var grid4 = $('#grid').data('kendoGrid');
                        grid4.hideColumn(10);
                         var grid4 = $('#grid').data('kendoGrid');
                        grid4.hideColumn(11);
                        
                        
               }
              

                </script>

    <?php
    
    }
}
?>

                
<script>
    $(document).ready(function(){
       
       
    
    });
    
                
</script>
                
                
                <div class="homecontainer">
	<div class="taskdiv">		
		<!--<p class="logout">Welcome <?=$username?> [<a href="logout.php">Logout</a>]</p>-->
		<div class="task">
<!--			<div class="statusdrop">
			<p class="statustext">Status &nbsp&nbsp</p>
			<select id="status" onchange="getdata(1);">
			<?foreach($currentstatuses as $value){?>
				
				<option value="<?=$value?>"><?php echo $value?></option>
			<?}?>	
			</select>
			</div>-->
			<div class="priodrop">
			<p class="priotext">Priority &nbsp&nbsp</p>
			<?
			$priority=getpriority($username,$pass,$host);						
			?>
				<select name="priority" id="priority">
					<option value="">ALL</option>
					<?
					foreach($priority as $key){
					?>
					<option value='<?=$key->name?>'><?=$key->name?></option>
					<?}?>
				</select>
			</div>
			<div class="postdrop">
			<p class="posttext">Post &nbsp&nbsp</p>
			<?
			$postsql="select * from sys_jobposts where active='1'";
			$execpostquery =mysql_query($postsql);						
			?>
				<select name="post" id="post">
					<option value="">ALL</option>
					<?
					while($posts = mysql_fetch_array($execpostquery)){
					?>
					<option value='<?=$posts['code']?>'><?=$posts['code']?></option>
					<?}?>
				</select>
			</div>
			<div class="assigneedrop">
			<p class="assigneetext">Assignee &nbsp&nbsp</p>
			<?$user=getuser($username,$pass,$project,$host);?>
				<select id="assignee">
					<option value="">ALL</option>
					<?foreach($user as $key){?>		
						<option name="assignee" value="<?php echo $key->name ?>"><?php echo $key->name ?></option>
					<?}?>	
				</select>
			</div>
			
<!--			<form action='deletedata.php' method='post'>
			<div class="reports">
				<a href="reports/reports.php" title="View Reports"><img src="images/reports.jpg" style="width:30px;"/></a>
			</div>
			<div class="deletebutton">
				<input type="submit" value="Delete" name="delete" id="delete">	
			</div>
                        </form>-->
			
                              <div class="taskcontainer">
				<div id="example" class="k-content">      
                                    
                                    <div id="grid" ></div>
                <style scoped>
                #clientsDb {
                    width: 692px;
                    height: 413px;
                    margin: 30px auto;
                    padding: 51px 4px 0 4px;
                    background: url('../../content/web/grid/clientsDb.png') no-repeat 0 0;
                }
                 #grid:hover{
                        cursor: pointer;
                    
                       
                    }
                  
            </style>
                                </div>
			</div>
		</div>
	</div>
	
    
  
</div>
       

        
    </body>
</html>
